package com.googlecode.garbagecan.cxfstudy.compress;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.transport.common.gzip.GZIPInInterceptor;
import org.apache.cxf.transport.common.gzip.GZIPOutInterceptor;

public class MyServer {

	private static final String address = "http://localhost:9000/ws/compress/bigDataService";

	public static void main(String[] args) {
		JaxWsServerFactoryBean factoryBean = new JaxWsServerFactoryBean();
		factoryBean.getInInterceptors().add(new LoggingInInterceptor());
		factoryBean.getOutInterceptors().add(new LoggingOutInterceptor());
		factoryBean.getInInterceptors().add(new GZIPInInterceptor());
		factoryBean.getOutInterceptors().add(new GZIPOutInterceptor());

		factoryBean.setServiceClass(BigDataServiceImpl.class);
		factoryBean.setAddress(address);
		factoryBean.create();
	}

}
